import request from '@/utils/request';

export async function getUserList(params) {
  return request('/user/getUserList', {
    params,
  });
}

export async function manualSyncUser(params) {
  return request('/user/manualSyncUser', {
    params,
  });
}

export async function getUserDetail(params) {
  return request('/user/getUserDetail', {
    params,
  });
}

export async function resetPasswords(params) {
  return request('/user/resetPasswords', {
    method: 'post',
    params,
  });
}

export async function updateUserState(params) {
  return request('/user/updateUserState', {
    method: 'post',
    params,
  });
}

export async function updateUserLockState(params) {
  return request('/user/updateUserLockState', {
    method: 'post',
    params,
  });
}

export async function updateUser(data) {
  return request('/user/updateUser', {
    method: 'post',
    data,
  });
}

export async function getDepartmentTreeByRole(params) {
  return request('/user/getDepartmentTreeByRole', {
    params,
  });
}

export async function findRoleByUpdate(params) {
  return request('/user/findRoleByUpdate', {
    params,
  });
}

export async function findRoleByUserId(params) {
  return request('/user/findRoleByUserId', {
    params,
  });
}

export async function getSelectCityInfo(params) {
  return request('/dp/sys/getSelectCityInfo', {
    params,
  });
}

// 收藏的菜单
export async function favoriteMenu() {
  return request('/user/favoriteMenu');
}

// 取消或者收藏
export async function cancelOrKeep(params) {
  return request('/user/cancelOrKeep', {
    params,
  });
}